import Mock from 'mockjs';

export function mock() {
    // 商品列表
    Mock.mock(/good/, 'post', {
        status: 0,
        message: 'OK',
        data: [
            {
                id: 3,
                name: '婚纱摄影',
                category: '婚介',
                cover: [
                    'http://www.baidu.com/image.jpg',
                ],
                list_cover: 'http://www.baiduc.om/list_cover.jpg',
                display_price: 19000,
                price: 123,
                // 0 | 1
                is_crowd: 0,
                share_number: 2,
                visitor: 2,
            },
        ],
    });

    // 商品详情
    Mock.mock(/good\/detail/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            shop_id: 123,
            name: '婚纱摄影',
            cover: [
                'http://www.baidu.com/image.jpg',
            ],
            video: 'http://www.baidu.com/video.mp4',
            display_price: 19000,
            description: '描述内容',
            price: 123,
            sales_volume: 0,
            is_crowd:[0|1],
            is_free:[0|1],
            attr: ['颜色', '大小'],
            attr_value:{
                '颜色': ['红色', '黑色'],
                '大小': ['XL', 'XXL', 'L'],
            },
            spec: [
                {
                    id: 12,
                    param: {
                        id: 23,
                        param: {'颜色': '红色', '大小': 'XL'},
                        price: 23100,
                        prepay_price:1200,
                        stock: 23900,
                    },
                    sales_volume:123,
                    stock:12,
                    price:123,
                },
            ],
        },
    });

    // 店铺商品列表
    Mock.mock(/shop\/goods/, 'post', {
        status: 0,
        message: 'OK',
        data: [
            {
                id: 3,
                type: 'good',
                name: "婚纱摄影",
                category: "婚介",
                cover: [
                    'http://www.baidu.com/image.jpg',
                ],
                display_price: 19000,
                price: 123,
                is_crowd: 0,
                share_number: 2,
                visitor: 2,
            },
        ],
    });

    // 获取评论列表
    Mock.mock(/good\/comment/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                id: 23,
                nickname: '昵称',
                avatar: 'http://www.baidu.com/avatar.jpg',
                content: '内容',
                score: 2,
                image: [
                    'http://www.baidu.com/image.jpg',
                ],
                created_at: '2019-10-19',
            },
        ],
    });

    // 获取海报
    Mock.mock(/good\/poster/, 'get', {
        status: 0,
        message: 'OK',
        data: 'https://static.playground.forzoom.tech/meta/square/1.jpg',
    });
}
